package org.budo.mongo.jdbc.driver.executor;

import java.sql.PreparedStatement;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.budo.mongo.jdbc.driver.statement.StatementDocument;

/**
 * @author lmw
 */
public interface MongoStatementExecutor {
    void close();

    Iterator<?> listDatabaseNames();

    Iterator<?> listCollectionNames();

    void insert(String collectionName, List<Map<String, Object>> insertDocuments, PreparedStatement preparedStatement);

    Integer update(String collectionName, Map<String, Object> whereDocument, Map<String, Object> updateDocument);

    Integer delete(String collectionName, Map<String, Object> whereDocument);

    Iterator<?> find(String collectionName, StatementDocument statementDocument);

    long count(String collectionName, Map<String, Object> whereDocument);

    Iterator<?> aggregate(String collectionName, List<Map<String, Object>> aggregatePipeline);

    List<?> eval(String evalScript);
}